package com.example.lenovo.appstore.activity;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.example.lenovo.appstore.R;
import com.example.lenovo.appstore.base.BaseActivity;
import com.example.lenovo.appstore.utils.AppContext;
import com.example.lenovo.appstore.utils.AppManager;
import com.example.lenovo.appstore.utils.StatusBarUtil;
import com.example.lenovo.appstore.utils.ToastUtil;
import com.example.lenovo.appstore.view.TitleBarView;

import butterknife.Bind;
import butterknife.ButterKnife;

public class SettingNewPWDActivity extends BaseActivity implements View.OnClickListener {
    @Bind(R.id.setting_pwd)
    TitleBarView titleBarView;
    @Bind(R.id.new_pwd)
    EditText new_pwd;
    @Bind(R.id.confrim_pwd)
    EditText confrim_pwd;
    @Bind(R.id.setting_confrim)
    TextView setting_confrim;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting_new_pwd);
        ButterKnife.bind(this);
        initView();
    }

    @Override
    protected void initView() {
        titleBarView.setTitle(AppContext.getInstance().getResources().getString(R.string.setting_newpwd));
        titleBarView.showBackButton(true);
        StatusBarUtil.setStatusBarLightMode(getWindow());
        initListener();
    }

    @Override
    protected void initListener() {
        setting_confrim.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.setting_confrim:
                ToastUtil.makeText(SettingNewPWDActivity.this,AppContext.getInstance().getResources().getString(R.string.changepwd_sucesss));
                Intent intent = new Intent(SettingNewPWDActivity.this,LoginActivity.class);
                startActivity(intent);
                AppManager.getInstance().killAllActivity();
                break;
        }
    }
}
